<template>
  <div>
    <el-form :inline="true" :model="formInline" class="demo-form-inline">
      <el-form-item label="分类名称" size="small">
        <el-input v-model="formInline.user" placeholder="请输入分类名称关键字"></el-input>
      </el-form-item>
      <el-button icon="el-icon-search" size="small">搜索</el-button>
      <el-button icon="el-icon-search" size="small">重置</el-button><br />
      <el-button type="primary" size="small">新增分类</el-button>
    </el-form>
    <el-table

      :data="lassify"
      style="width: 100%; margin-bottom: 20px"
      row-key="id"
      border
      :tree-props="{ children: 'child', hasChildren: 'hasChildren' }"
      :default-expand-all="false"
    >
      <el-table-column prop="title" label="分类名称" width="500"></el-table-column>
      <el-table-column prop="library_num" label="数量" width="300"> </el-table-column>
      <el-table-column prop="sort" label="序号"></el-table-column>
      <el-table-column label="操作">
        <el-button type="text" size="small"> 新增 </el-button>
        <el-button type="text" size="small"> 编辑 </el-button>
        <el-button type="text" size="small"> 删除 </el-button>
      </el-table-column>
    </el-table>
  </div>
</template>

<script>
import { getclassify } from '../../api'
export default {
  data() {
    return {
      formInline: {
        user: '',
        region: ''
      },
      lassify: []
    }
  },
  methods: {},
  created() {
    getclassify().then((res) => {
      console.log(res)
      this.lassify = res.data
    })
  }
}
</script>

<style>
.demo-table-expand {
  font-size: 0;
}
.demo-table-expand label {
  width: 90px;
  color: #99a9bf;
}
.demo-table-expand .el-form-item {
  margin-right: 0;
  margin-bottom: 0;
  width: 50%;
}
</style>
